package cn.cat.main.callable;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
import java.util.concurrent.ThreadPoolExecutor;

public class TaskTest {

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            Task task = new Task(i);
            FutureTask<Object> futureTask = new FutureTask<Object>(task);
            /*Thread thread = new Thread(futureTask);
            thread.start();*/
            //futureTask.run();
            //以上两种线程启动方式不能获取callable线程执行的结果，必须结合线程池的方式
        }
    }
}
